package service.impl;

import java.util.List;

import javax.annotation.Resource;

import model.Person;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import service.PersonService;
import dao.PersonDAO;

@Component("personService")
@Transactional
public class PersonServiceImpl implements PersonService {
	@Resource
	private PersonDAO personDAO;

	public void add(Person person) {
		personDAO.add(person);
	}

	public void delete(Person person) {
		personDAO.delete(person);
	}
	
	@Transactional(propagation=Propagation.NOT_SUPPORTED ,readOnly=true)
	public List<Person> listAll() {
		return personDAO.listAll();
	}

	public void update(Person person) {
		personDAO.update(person);
	}

}
